"advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bufstream 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cargotest 0.1.0",
+ "chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)",
"crates-io 0.7.0",
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"tar 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+[[package]]
+name = "chrono"
+version = "0.2.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
[[package]]
name = "cmake"
version = "0.1.20"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum bufstream 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b48dbe2ff0e98fa2f03377d204a9637d3c9816cd431bfe05a8abbd0ea11d074"
"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c"
+"checksum chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00"
"checksum cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "a3a6805df695087e7c1bcd9a82e03ad6fb864c8e67ac41b1348229ce5b7f0407"
"checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97"
"checksum curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c90e1240ef340dd4027ade439e5c7c2064dd9dc652682117bd50d1486a3add7b"
path = "src/cargo/lib.rs"
[dependencies]
+chrono = "0.2.25"
crates-io = { path = "src/crates-io", version = "0.7" }
crossbeam = "0.2"
curl = "0.4.6"
tar = { version = "0.4", default-features = false }
tempdir = "0.3"
term = "0.4.4"
-time = "0.1.36"
toml = "0.3"
url = "1.1"
#[macro_use] extern crate log;
#[macro_use] extern crate serde_derive;
#[macro_use] extern crate serde_json;
+extern crate chrono;
extern crate crates_io as registry;
extern crate crossbeam;
extern crate curl;
extern crate tar;
extern crate tempdir;
extern crate term;
-extern crate time;
extern crate toml;
extern crate url;
use term::color::BLACK;
+use chrono::{Datelike,Local};
use handlebars::{Handlebars, no_escape};
use tempdir::TempDir;
-use time;
use toml;
use core::Workspace;
let mut data = BTreeMap::new();
data.insert("name".to_owned(), name.to_owned());
data.insert("author".to_owned(), author);
+ data.insert("year".to_owned(), Local::now().year().to_string());
let template_set = try!(get_input_template(config, opts));
for template in template_set.template_files.iter() {
extern crate cargo;
extern crate cargotest;
+extern crate chrono;
extern crate hamcrest;
extern crate tempdir;
-extern crate time;
use std::fs::{self, File};
use std::io::prelude::*;
use cargo::util::ProcessBuilder;
use cargotest::process;
use cargotest::support::{execs, git, paths};
+use chrono::{Datelike,Local};
use hamcrest::{assert_that, existing_file, existing_dir, is_not};
use tempdir::TempDir;
assert_that(&paths::root().join("foo/Cargo.toml"), existing_file());
assert_that(&paths::root().join("foo/src/main.rs"), existing_file());
+ let license = paths::root().join("foo/LICENSE");
+ let mut contents = String::new();
+ File::open(&license).unwrap().read_to_string(&mut contents).unwrap();
+ assert!(contents.contains(&format!("(c) {} {}", Local::now().year(), "foo")));
+
assert_that(cargo_process("build").cwd(&paths::root().join("foo")),
execs().with_status(0));
assert_that(&paths::root().join(&format!("foo/target/debug/foo{}",